import React, { useEffect } from 'react'
import { useNavigate } from 'react-router-dom'
import { NavBar, Button } from 'antd-mobile'
import '../../css/yjh/Apps.css'
import Maps from './MapContainer2'
import { useLocation } from 'react-router-dom'
export default function SelectAddress() {
  const location = useLocation()
  const { totalprice } = location.state

  const navgiter = useNavigate()
  const gotoPay = () => {
    navgiter('/pays',{state:{totalprice:totalprice}})
  }
  const gotoapps = () => {
    navgiter('/apps')
  }
  const back = () => {
    gotoapps()
  }
  const inputValue = JSON.parse(localStorage.getItem('inputValue')) || {};


  return (
    <div>
      <NavBar back='选择地址' onBack={back} />
      <div className='maps'>
        <Maps></Maps>
      </div>
      <div className='Nexts'>
      <h5>地址: {inputValue.name}</h5>
        <Button onClick={gotoPay}>下一步</Button>
      </div>


    </div>
  )
}
